package src.mock.tomcat;

public abstract class MockServlet {
    public abstract void doGet(MockRequest mockRequest,MockResponse mockResponse);
    public abstract void doPost(MockRequest mockRequest,MockResponse mockResponse);
    public void service(MockRequest mockRequest,MockResponse mockResponse){
        if(mockRequest.getMethod().equalsIgnoreCase("POST")){
            doPost(mockRequest,mockResponse);
        }else{
            if(mockRequest.getMethod().equalsIgnoreCase("GET")){
                doGet(mockRequest,mockResponse);
            }else{
                //待支持方法
            }
        }
    }
}
